home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 352_01 / makedb.bat < prev    next >
DOS Batch File  |  1991-04-16  |  1KB  |  46 lines

  1. @ECHO OFF
  2. CLS
  3. ECHO This .BAT file compiles DBLIB under C++
  4. REM
  5.     REM validate model. 
  6.     set mdl=%1
  7.     for %%a    in ( s m l t h c y ) do  if (%mdl%)==(%%a) goto :alright
  8.     ECHO parameter 1 must be memory model, or y for overaly, large model.
  9.     goto :quit
  10. :ALRIGHT
  11.     set ovrly=
  12.     if  NOT (mdl) == (y)  goto :NOLAY
  13.         REM overalys specified by 'y' as model.
  14.         set mdl=l
  15.         set ovly=-Yo
  16.     :NOLAY  
  17.  
  18.  
  19.  
  20.     if exist *.obj    erase *.obj
  21.     if (%2) == () goto  :ALLFILE
  22.         REM specific files were given to compile.
  23.         @ECHO ON    
  24. tcc -c -m%mdl% %olay% %2 %3 %4 %5 %6 %7 %8 %9 >errors.lst
  25.         @ECHO OFF
  26.         goto :HAVEOBJ
  27.     :ALLFILE
  28.         REM no files specified, so do all files.
  29.         @ECHO ON    
  30. tcc -c -m%mdl% %olay% *.c* > errors.lst
  31.         @ECHO OFF 
  32.     :HAVEOBJ
  33.     if NOT EXIST *.obj goto :DONE
  34.     dir *.obj  | dir2bat -+@ & > obj.lst
  35.     echo ,liblst               >>obj.lst
  36.     @ECHO ON
  37.     tlib dblib%1 @obj.lst >> errors.lst
  38.     @ECHO OFF
  39.     if exist *.obj          erase *.obj
  40.     if exist obj.lst        erase obj.lst
  41.     if exist dblib?.bak     erase dblib?.bak
  42.  
  43. :DONE
  44. ECHO library made. Compiler and Librarian messages are in errors.lst
  45. :QUIT
  46.